import * as React from 'react'; import { Flex, LoaderProps, SelectField, SwitchField, TextField, } from '@aws-amplify/ui-react'; export interface LoaderPropControlsProps extends LoaderProps { setSize: (value: React.SetStateAction) => void; setVariation: (value: React.SetStateAction) => void; setEmptyColor: ( value: React.SetStateAction ) => void; setFilledColor: ( value: React.SetStateAction ) => void; setIsDeterminate: ( value: React.SetStateAction ) => void; setPercentage: ( value: React.SetStateAction ) => void; setIsPercentageTextHidden: ( value: React.SetStateAction ) => void; } export const LoaderPropControls: React.FC = ({ size, setSize, variation, setVariation, emptyColor, setEmptyColor, filledColor, setFilledColor, isDeterminate, setIsDeterminate, percentage, setPercentage, isPercentageTextHidden, setIsPercentageTextHidden, }) => { return ( setSize(event.target.value as LoaderProps['size'])} > setVariation(event.target.value as LoaderProps['variation']) } > setEmptyColor(event.target.value)} /> setFilledColor(event.target.value)} /> { setIsDeterminate(event.target.checked), setPercentage(undefined); }} /> {isDeterminate ? ( setPercentage(parseInt(event.target.value))} /> ) : null} {isDeterminate ? ( setIsPercentageTextHidden(event.target.checked)} /> ) : null} ); };